package utd.cs6322.cluster.document;

import java.io.File;
import java.io.IOException;

import net.sf.javaml.core.Dataset;
import net.sf.javaml.core.DefaultDataset;
import net.sf.javaml.tools.data.FileHandler;

public class DocumentManager {

	private Dataset data;
	private boolean hasData;
	
	public DocumentManager() {
		data = new DefaultDataset();
		hasData = false;
	}
	
	public void readDocument(File file){
		try {
			data = FileHandler.loadSparseDataset(file, 0, " ", ":");
		} catch (IOException e) {
			e.printStackTrace();
			System.exit(1);
		}
		hasData = true;
	}
	
	public boolean hasData(){
		return hasData;
	}
	
	public Dataset getData(){
		return data;
	}
	
}
